package com.forum.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.forum.util.RedisClient;

@Controller
public class ForumLoginController {
   
   @RequestMapping(value="/forum_login", method = RequestMethod.GET)
   public void forumLogin(HttpServletRequest request,HttpServletResponse response) 
   {
	  
//	   System.out.println("forumLogin method");
//	   /*
//		 * 获取用户的openid
//		 * 
//		 */
////		String openid=request.getParameter("openid");
//	    String openId="ohRGkxLweiUcY9KZneONihLP_6GE".toLowerCase();
//		String email=openId+"@qq.com";
//		/*
//		 * 
//		 * 在之前的RedisClient。java中增加了一个方法check（）
//		 */
//		boolean login=new RedisClient().check(email);
//	    try 
//		{
//		   if(login)
//		      response.sendRedirect("http://42.96.209.192:4567/login?username="+email+"&password=123456");
//		   else
//	          response.sendRedirect("unregist.jsp");
//		} 
//	    catch (IOException e) {
//			e.printStackTrace();
//		}
   }
}
